import { pubRequire } from '@utils/public'
const baseUrl = '/reads/me'

//我的发布列表
export function getReadMineList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
//我的发布-发布
export function pubRead(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
//我的发布-保存（草稿）
export function saveRead(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/draft`, obj, callbBack, errBack)
}
//我的发布-编辑
export function editRead(obj, id, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callbBack, errBack)
}
//我的发布-编辑（草稿）
export function editSaveRead(obj, id, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/draft/${id}`, obj, callbBack, errBack)
}
//删除
export function delItem(id, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callbBack, errBack)
}
//按照id查询我的发布
export function getDetail(id, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callbBack, errBack)
}
